package June;

public class Test_18_1 {
    public static void main(String[] args) {
        A01 a = new A01();
        System.out.println("double数组中的最大值 = " + a.max(1.5, 10.9, 2.3, 20.7));
    }
}

// 编写类A01，定义方法max，
// 实现求某个double数组的最大值，并返回
class A01 {
    public double max(double... d) {
        double max = d[0];
        for (int i = 1; i < d.length; i++) {
            if (max < d[i]) {
                max = d[i];
            }
        }
        return max;
    }
}

